package com.zjd.swing.browser;

import chrriis.dj.nativeswing.swtimpl.components.*;

import java.awt.*;

/**
 * @Description: ${description}
 * @Author: sobey
 * @Email: sobey178@163.com
 * @Date: 2022/3/27 0:42
 */
public class MyWebBrowserListener extends WebBrowserAdapter {
    @Override
    public void locationChanged(WebBrowserNavigationEvent event) {
        System.out.println(event.toString());
        Component[] components = event.getWebBrowser().getComponents();
        for (Component component : components) {
            System.out.println("【component】"+component.toString());
        }
        event.getWebBrowser().executeJavascript("$('#kw').val('自动搜索');$('#su').click();");
    }
}
